Skip to content

show version from pyproject.toml file and show in in footer , the gi… - #27

Merged
denkv merged 9 commits into
developfrom
develop-showversion
Sep 14, 2026
Merged

denkv merged 9 commits into
developfrom
develop-showversion

Conversation

@farshad68

Copy link
Copy Markdown
Member

…t hash is also available and show as tooltip

@farshad68
farshad68 requested a review from denkv April 14, 2026 09:21
Comment thread learn2rag/ui/__init__.py Outdated

def get_version() -> str:
try:
with open("pyproject.toml", "rb") as f:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with a packaged version?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from importlib.metadata import version, PackageNotFoundError
try:
    return version('learn2rag')
except PackageNotFoundError:
    return 'unknown'

@denkv denkv self-assigned this Aug 26, 2026
Comment thread learn2rag/ui/__init__.py Outdated

def get_git_hash() -> str:
try:
return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text=True subprocess option instead of decode()

@denkv
denkv merged commit f9db093 into develop Sep 14, 2026
1 check passed
@denkv
denkv deleted the develop-showversion branch September 14, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants